<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">

BODY{
font-size:30px;
}
table{margin: 0px auto}
span{text-align: center;vertical-align: top;}
.circle{border: 3px dashed #6495ED;margin: 100px auto;background-color: #FFE4E1}
.circle form{display:block;margin:0px auto;}
.submit{margin-left: 300px;width: 100px;height: 60px}
input{font-size: 30px}
.choose{font-size: 30px}
</style>

<SCRIPT language=javascript>

function check_file()

{

var strFileName=form1.FileName.value;

if (strFileName=="")

{

    alert("请选择要上传的文件");

    return false;

}

}

</SCRIPT>

<script language="javascript">

// javascript 动态添加 input type="file"

var i = 1;

function addFile(dvID, inputNamePrefix)

{

var dv = document.getElementById(dvID);

var file = document.createElement("input");

file.type = "file";


file.id = file.name = inputNamePrefix + i;

dv.appendChild(file);

var btn = document.createElement("input");

btn.type = "button";

btn.id = btn.name = "btn" + i;

btn.value = "删除" ;

btn.onclick = function() {

var b = document.getElementById(btn.id);

dv.removeChild(b.nextSibling); //remove <BR>

dv.removeChild(b.previousSibling); //file

dv.removeChild(b); //btn
};

dv.appendChild(btn);

dv.appendChild(document.createElement("BR"));

i++;

}

</script>

</head>

<body>

<!--

<form action="upfile.jsp" method="post" name="form1" onSubmit="return check_file()" enctype="multipart/form-data">

<input name="FileName" type="FILE" size="20">

<input type="submit" name="Submit" value="上传">

</form>

-->
<div class="circle">

<form action="${pageContext.request.contextPath}/uploading" method="post" name="form1" onsubmit="return check_file()" enctype="multipart/form-data" >
<table>
<tr>
	<td><div id="dvTitles"></div></td>
</tr>
<tr>
	<td>如需上传多个图片请点击：<input type="button" value="添加文件" onclick="addFile('dvTitles','file')">&nbsp;&nbsp;</td>
</tr>
<tr><td> <br/></td><td></td><td></td></tr>
<tr><td><br/></td><td></td><td></td></tr>

<tr>
	<td><span><h1>备注信息：</h1></span><textarea style="font-size:30px" name="ps" rows="8" cols="40" placeholder="建议说明作业上交时间或其他信息……"></textarea></td>
</tr>
<tr>
	<td><span class="choose">科目选择：</span>
	
		<select style="font-size:30px" name="course_acronym">
			<option value="jh">交换技术与现代通信网</option>
			<option value="it">IT项目管理</option>
			<option value="yd">移动通信</option>
			<option value="sj">数据挖掘</option>
			<option value="wl">计算机网络</option>
			<option value="ds">数字电视</option>
			<option value="gd">光电技术与光纤基础</option>
			<option value="tx">数字图像处理</option>
			<option value="xc">形式与政策</option>
			<option value="cj">网络与通信程序设计</option>
		</select>
	</td>
</tr>
<tr>
	<td>
		<input class="submit" type="submit" name="Submit" value="提交">
	</td>
</tr>
</table>
</form>

</div>
</body>

</html>